home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / c_course.zip / POINTER.C < prev    next >
Text File  |  1989-12-30  |  526b  |  12 lines

  1. main()                      /* illustration of pointer use */
  2. {
  3. int index,*pt1,*pt2;
  4. int a1[560];
  5.  
  6.    index = 39;                      /* any numerical value */
  7.    pt1 = &index;                   /* the address of index */
  8.    pt2 = pt1;
  9.    printf("The value is %d %d %d\n",index,*pt1,*pt2);
  10.    *pt1 = 13;           /* this changes the value of index */ 
  11.    printf("The value is %d %d %d\n",index,*pt1,*pt2);
  12. }